The present invention relates to a resource allocation method in computer system, and more particularly to such a method in which resources are allocated in units of one process or one process group.
In a computer system in which a plurality of processes are executed in parallel, it is required that a resource such as a file allocated to a certain process should not be allocated to another process until the certain process completes a lump of logical processing. This kind of control technique for resource allocation to processes is generally called exclusive control.
With the advancement of hardware techniques, there is nowadays generally used a parallel processing in which a processing hitherto performed by one process is performed in a divided manner by a plurality of processes having a logical relationship therebetween (called as a process group). In this case, a need to control the allocation of resources in units of one process as usual while controlling it in units of one process group is caused in order to obtain a significant result which is logically consistent. Therefore, JP-A-6-161861 has disclosed a file processing control system in which the allocation of resources is controlled in units of one process group.
In the file processing control system disclosed by the JP-A-6-161861, a process managing section manages the correspondence of processes to process groups to which that the respective processes belong. When a process declares which of process groups that process belongs to, a relationship in correspondence between the process and the process group is registered into the process managing section. In the case where a resource requested by the process is not being used or is being used by a process which belongs to the same process group, that resource is allocated to the requesting process. On the other hand, in the case where that resource is being used by a process which belongs to another process group, the allocation of that resource to the requesting process is rejected.
The above-mentioned prior art has the following problems.
A first problem concerns the sequence of allocation of a resource to process groups. In the prior art, a resource is allocated to a process group which makes a request for the allocation of the resource first after the release of the resource. Accordingly, there is generated a situation in which a resource is allocated to not an earlier requesting process group which made a request for the allocation of a resource before the release of the resource but to a later requesting process group which makes a request for the allocation of the resource after the release of the resource.
A second problem concerns a wait for allocation of a resource for processes which belong to a process group. In the prior art, in the case where a resource is not allocated, a process repeats a request for the allocation of the resource until the resource is allocated. Therefore, the processing time of a CPU executing that process is wasted.
A third problem concerns the sequence of allocation of a resource to processes. In the prior art, processes belonging to the same process group have thereamong no relationship between the sequence of requests for allocation of a resource by the individual processes and the sequence of allocation of the resource to the individual processes. Accordingly, there is generated a situation similar to that in the first problem, that is, a situation called "sunk" state in which a great deal of time is taken for the allocation of a resource or a situation called "hungered" state in which a resource is not allocated almost permanently.
A fourth problem concerns the sharing of a resource among process groups. If only the reference to a resource is to be made by both a first process group and a second process group, it is possible to allocate the resource to the first and second process groups concurrently. In the prior art, however, a resource is always allocated to only one process group irrespective of the manner of use of a resource by process groups.
A fifth problem concerns the sharing of a resource among processes. If only the reference to a resource is to be made by both a first process and a second process, it is possible to allocate the resource to the first and second processes concurrently. In the prior art, however, the exclusive allocation of a resource to one process in the same process group is not taken into consideration. Therefore, if the same process group has a plurality of processes performing the writing for a resource, there may be the case where there is not obtained a significant result which is logically consistent.